<template>
  <Button v-if="handleCheck()" :type="type" @click="handleClick">{{title}}</Button>
</template>

<script>
export default {
  name: 'AuthButton',
  props: {
    title: {
      type: String,
      required: true
    },
    code: {
      type: String,
      required: true
    },
    type: {
      type: String,
      required: true
    },
  },
  methods: {
    handleClick () {
      return this.$emit("on-click")
    },
    handleCheck() {
      return this.$hasBtnPerm(this.code)
    }
  }
}
</script>

<style>

</style>
